package com.petter.gradlespringboot.proxy;

import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author : GD
 * @date :2021/7/7 : 11:33
 */
public class UserCGLibProxy implements MethodInterceptor {
    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("before CGLib !!!");
        Object result = methodProxy.invokeSuper(o, objects);
        System.out.println("after CGLib !!!");
        return result;
    }
}
